using System;
using System.Collections.Generic;
using System.Text;

namespace SharpScratch
{

    public class BaseClass
    {
        public virtual void Test(ISomething passed)
        {
            
        }
    }

    public class TestSubject : BaseClass
    {
        private ISomething _Thing;
        private Boolean _Heard;

        public Boolean Heard
        {
            get
            {
                return _Heard;
            }
            set
            {
                _Heard = value;
            }
        }

        public ISomething Thing
        {
            get
            {
                if (_Thing == null)
                    _Thing = new Something();
                return _Thing;
            }
            set
            {
                _Thing = value;
            }
        }

        public TestSubject()
        {
            this.Thing.From.Stuff.GetIt();
        }

        public void Attach()
        {
            this.Thing.ListenToMe += new Something.ListenToMeHandler(Listener);
        }

        protected void Behind()
        {
            
        }

        public override void Test(ISomething passed)
        {
            passed.From.Stuff.GetIt();
            ISomething TempVar = new Something();
            TempVar = this.Thing;
            String What = TempVar.From.Stuff.GetIt();
            System.Diagnostics.Debug.Assert(What == "You got it!");
            System.Diagnostics.Debug.Assert(this.Heard);
            this.Thing.Holds = "This";
            String Get = this.Thing.Holds;
            System.Diagnostics.Debug.Assert(Get == "This");
            this.Behind();
            base.Test(passed);
        }

        public void Listener()
        {
            this.Heard = true;
        }
    }

}
